var appstoreMessage = {
    'parent': window.parent,
    'getWebsiteInfo': function () {
        parent.postMessage({'type': 'getWebSiteInfo'}, '*');
    },
    'startSetup': function ($id) {
        if(top== self){
            toast.error('请在后台云市场进行安装。');
            return;
        }

        $.post(U('Appstore/Index/getSetupToken'), {'version_id': $id}, function (data) {
            if (data.status) {
                toast.success('验证成功。即将跳转到本地云市场进行安装。')
                setTimeout(function () {
                    parent.postMessage({'type': 'install', 'token': data.info, 'cookie': $.cookie('PHPSESSID')}, '*');
                }, 1500);
            }
            else {
                toast.error(data.info);
            }
        });
    }
};